#ifndef WAVHEADSTRUCTURE_H
#define WAVHEADSTRUCTURE_H
#include <QObject>

struct WAVHeadStructure
{

    uint8_t riffChunkId[4] = {'R','I','F','F'};
    /**
     *  数据的总大小 = 文件大小 - (riffChunkId + chunkAllSize )
     *  数据的总大小 = 文件大小 - 8
     */
    uint32_t chunkAllSize;

    // wav 文件格式
    uint8_t wave[4] = {'W','A','V','E'};
    // ftm+空格
    uint8_t fmt[4] = {'f','m','t',' '};

    uint32_t fmtSize = 16;
    // 数据文件格式，PCM数据对应1,浮点数对应3
    uint16_t audioFormat = 1;
    // 声道数
    uint16_t numChannels;
    // 采样频率
    uint32_t sampleRate;
    // 字节率 sampleRate * blockAlign
    uint32_t byteRate;
    // 一个样本的字节数 bitPerSample * numChannels >> 3
    uint16_t blockAlign;
   // 位深度
    uint16_t bitPerSample;

    uint8_t dataChunkId[4] = {'d','a','t','a'};

    uint32_t dataChunkSize;
};

#endif // WAVHEADSTRUCTURE_H
